{{--<div class="bjui-pageHeader" style="background-color:#fefefe; border-bottom:none;">--}}
    {{--<form data-toggle="ajaxsearch"--}}
          {{--data-options="{url:'urcbwyjr/personnel/company-address-list',searchDatagrid:$.CurrentNavtab.find('#company-address-list')}">--}}
        {{--<fieldset>--}}
            {{--<legend style="font-weight:normal;">企业搜索：</legend>--}}
            {{--<div style="margin:0; padding:1px 5px 5px;">--}}
                {{--<span>承租人：</span>--}}
                {{--<input type="text" name="name" class="form-control" size="20">--}}
                {{--<button type="submit" class="btn-green" data-icon="search">开始搜索！</button>--}}
                {{--<button type="reset" class="btn-orange" data-icon="times">重置</button>--}}
            {{--</div>--}}
        {{--</fieldset>--}}
    {{--</form>--}}
{{--</div>--}}
<div class="bjui-pageContent">
    <table id="resign-personnel-list" class="table table-bordered" data-toggle="datagrid" data-options="{
        height: '100%',
        dataUrl: '/admin/personnel/resume/resign-personnel-list',
        delUrl: '/admin/personnel/resume/resign-personnel-del',
        delPK: 'id',
        paging: {showPagenum:10, selectPageSize:'20,50,100', pageCurrent:1, pageSize:20},
        fullGrid: true,
        linenumberAll: true,
        filterThead:false,
        fieldSortable:false,
        columnMenu:false,
        {{--showToolbar: true,--}}
        {{--toolbarCustom: toolbar,--}}
    }">
        <thead>
        <tr>
            <th data-options="{name:'contacts_name',align:'center',width:100}">姓名</th>
            <th data-options="{name:'mobile',align:'center',width:100}">手机号码</th>
            <th data-options="{name:'department_name',align:'center',width:100}">所属部门</th>
            <th data-options="{name:'position',align:'center',width:100}">职位</th>
            <th data-options="{name:'status',align:'center',width:100}">状态</th>
            <th data-options="{align:'center',width:100,render:operationColumn}">操作</th>
        </tr>
        </thead>
    </table>
</div>

<script type="text/javascript">
    function operationColumn(value, data) {
        if (data.status === '可加入人才库') {
            var html = '<button type="button" class="btn btn-blue" data-toggle="alertmsg" data-options="{type:\'confirm\', msg:\'你确定要将该员工添加到人才库吗？\', okCall:function(){joinTalentPool('+ data.id +')}}"><i class="fa fa-plus"></i> 加入人才库</button>';
        }
        return html;
    }
    function joinTalentPool(id)
    {
        BJUI.ajax('doajax', {
            url: '/admin/personnel/resume/join-talent-pool',
            data: {id: id},
            loadingmask: true
        });
        $('#resign-personnel-list').datagrid('refresh', true);
    }
</script>